%自定义部分
\renewcommand{\*}{\discretionary{\mbox{}}{}{}}%设置公式内的可选断行
\newcommand{\espace}{\vspace{-1em}\par}
\newcommand{\original}[1]{\newcommand{\nextauthor}{#1}}%加入原著者

\makeatletter
\let\Title\@title
\let\Author\@author
\let\Date\@date
\makeatother

\usepackage{syntonly}%仅编译不输出
\usepackage[top=18mm,bottom=18mm,left=12.7mm,right=12.7mm]{geometry}
\usepackage[bookmarksnumbered=true,pdftitle=\Title,pdfauthor=\Author,hidelinks,hyperindex,breaklinks]{hyperref}%超链接与pdf标签
\usepackage{nameref}%引用标题
\usepackage{multicol}%分栏
\setlength{\columnseprule}{0.3pt}
\usepackage{indentfirst}%第一行开启缩进
\usepackage{bookmark}

\usepackage{amssymb}%数学宏包
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{mathrsfs}
\usepackage{upgreek}%直立希腊字母
\usepackage{bm}%数学粗体
\usepackage{extarrows}%可延长箭头
\allowdisplaybreaks[3]%允许公式跨页
\numberwithin{equation}{section}%公式按节编号
\AtBeginDocument{%公式间距
    \setlength{\abovedisplayskip}{1pt plus 2pt minus 1pt}
    \setlength{\belowdisplayskip}{1pt plus 2pt minus 1pt}
    \setlength{\abovedisplayshortskip}{0pt plus 2pt}
    \setlength{\belowdisplayshortskip}{0pt plus 2pt}
    }
\thinmuskip=1mu%这段代码参考https://blog.csdn.net/xovee/article/details/107684429
\thickmuskip=1mu
\medmuskip=1mu
\input{0_定义.tex}

\usepackage{graphicx}%图片
\usepackage{float}%浮动体环境
\usepackage[perpage]{footmisc}%脚注
\usepackage{pifont}%符号扩展
\renewcommand\thefootnote{\ding{\numexpr171+\value{footnote}}}%脚注符号改变
\usepackage[normalem]{ulem}%下划线扩展
\usepackage{CJKfntef}%中文下划线扩展

\usepackage{fancyhdr}%页眉页脚
\pagestyle{fancy}
\fancyhf{}
\fancyhead[EL,OR]{\zihao{-3}\qquad \Title}
\fancyhead[ER,oL]{\zihao{-3}Made By Round \qquad}
\fancyfoot[C]{\zihao{-3}<\thepage>}
\renewcommand{\headrulewidth}{0.3pt}
\renewcommand{\footrulewidth}{0.3pt}

\setCJKmainfont{KaiTi}%字体
\setmainfont{Cambria}
\usepackage[bold-style=ISO,mathrm=sym,mathbf=sym,warnings-off={mathtools-colon,mathtools-overbracket}]{unicode-math}%数学字体
\setmathfont{Cambria Math}
\CJKsetecglue{\discretionary{\mbox{}}{}{}}%设置全半角字符间距
\punctstyle{banjiao}%半角标点
\setlength{\parindent}{0em}%首行缩进0

\usepackage[titles]{tocloft}%目录
\renewcommand{\cftpartleader}{\cftdotfill{\cftdotsep}}
\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}}
\renewcommand{\cftpartfont}{\cftsecfont}
\renewcommand{\cftchapfont}{\cftsecfont}
\renewcommand{\cftpartpagefont}{\cftsecpagefont}
\renewcommand{\cftchappagefont}{\cftsecpagefont}
\renewcommand{\cftsecnumwidth}{1em}
\setlength{\cftbeforepartskip}{\cftbeforesecskip}
\setlength{\cftbeforechapskip}{\cftbeforesecskip}
\setlength{\cftchapindent}{1em}
\setlength{\cftsecindent}{2em}

\usepackage[newparttoc]{titlesec}%标题
\titleclass{\part}{straight}
\titleformat{\part}[hang]{\zihao{-4}\bfseries\partformat}{\CTEXthepart}{0.28em}{}
\titlespacing*{\part}{0pt}{0pt}{0pt}
\titleclass{\chapter}{straight}
\titleformat{\chapter}[hang]{\zihao{-4}\bfseries\chapterformat}{\CTEXthechapter}{0.28em}{}
\titlespacing*{\chapter}{0pt}{0pt}{0pt}
\titleclass{\section}{straight}
\titleformat{\section}[hang]{\zihao{-4}\bfseries\sectionformat}{\CTEXthesection}{0em}{}
\titlespacing*{\section}{0pt}{0pt}{0pt}

\usepackage{xparse}
\newcounter{entry}[section]%编号计数器
\newcounter{hangentry}[entry]%subentry用控制悬挂计数器
\newcounter{subentryitem}%用于"临时保存"的一个参数,以实现subentry和theitem的嵌套
\newcounter{entryitem}[entry]%编号计数器
\newcommand{\thehang}[2]{\setlength{\parindent}{- #1 pt}\setlength{\leftskip}{#2 pt}}%定义缩进环境,第一个参数代表悬挂缩进量,第二个代表整体缩进量
\newenvironment{entryzero}%编号为0的悬挂0.5环境
    {\setcounter{hangentry}{5}\vspace{0em}\par\thehang{5}{\thehangentry}\theentry)\ignorespaces}
    {\par\vspace{0em}\setcounter{hangentry}{5}}
\newenvironment{itementry}%普通的编号悬挂0.5环境,次段0.5全部缩进
    {\vspace{0em}\par\setcounter{hangentry}{5}\addtocounter{entry}{1}\thehang{0}{\thehangentry}\hspace{-0.5em}\theentry)\ignorespaces}
    {\par\vspace{0em}\setcounter{hangentry}{5}}
\newenvironment{itementry*}%标号全部缩进0.5环境
    {\vspace{0em}\par\setcounter{hangentry}{5}\addtocounter{entry}{1}\thehang{\thehangentry}{\thehangentry}\theentry)\ignorespaces}
    {\par\vspace{0em}\setcounter{hangentry}{5}}
\newenvironment{entry}%悬挂0.5环境,几乎用不到
    {\vspace{0em}\par\setcounter{hangentry}{5}\addtocounter{entry}{1}\thehang{5}{\thehangentry}\ignorespaces}
    {\par\vspace{0em}\setcounter{hangentry}{5}}
\newenvironment{entry*}%全部缩进0.5环境,几乎用不到
    {\vspace{0em}\par\setcounter{hangentry}{5}\addtocounter{entry}{1}\thehang{\thehangentry}{\thehangentry}\ignorespaces}
    {\par\vspace{0em}\setcounter{hangentry}{5}}
\newenvironment{subentry}%多0.5悬挂缩进
    {\vspace{0em}\par\addtocounter{hangentry}{5}\thehang{5}{\thehangentry}\ignorespaces}
    {\par\vspace{0em}\addtocounter{hangentry}{-5}}
\newenvironment{subentry*}%多0.5全体缩进
    {\vspace{0em}\par\addtocounter{hangentry}{5}\thehang{0}{\thehangentry}\ignorespaces}
    {\par\vspace{0em}\addtocounter{hangentry}{-5}}
    \newenvironment{theitem}%编号,编号行0.5缩进,其余行全部缩进
    {\vspace{0em}\par\addtocounter{hangentry}{5}\setcounter{subentryitem}{\thehangentry}\setcounter{hangentry}{5}\begin{list}{\theentryitem .}{\usecounter{entryitem}\setlength{\topsep}{-0.25em}\setlength{\parsep}{0em}\setlength{\labelsep}{0em}\setlength{\parskip}{0em}\setlength{\leftmargin}{\thesubentryitem pt}\setlength{\rightmargin}{0em}\setlength{\itemindent}{\widthof{\theentryitem .}}\addtolength{\itemindent}{-0.5em}\setlength{\listparindent}{0em}\setlength{\itemsep}{0em}}\ignorespaces}
    {\end{list}\setcounter{hangentry}{\thesubentryitem}\addtocounter{hangentry}{-5}\par\vspace{0em}}
\newcommand{\iitem}{\addtocounter{entryitem}{1}\item[]\hspace{-0.8em}\theentryitem.}%当您的序号超过10时,您可以改用这个iitem以获得更完美的体验

\usepackage{enumitem}%在entry内使用有序列表,这个宏包保障了之后人名符号表的输出
\setlist[enumerate]{leftmargin=*,nosep,labelsep=0em,align=left}
\setlist[enumerate,1]{label={\arabic*.},ref={\arabic*},labelindent=\widthof{1)}}
\usepackage[nogroupskip,symbols,nonumberlist,nopostdot,toc=false]{glossaries-extra}
\input{1_人名符号表.tex}
\makenoidxglossaries
\glsaddall
\newglossarystyle{BibleStyle}{
    \setglossarystyle{list}
    \renewenvironment{theglossary}{\begin{description}[leftmargin=!,labelwidth=\widthof{Van der Waerden Van},nosep,font={\normalfont}]}{\end{description}}%\widthof代表了其后的宽度
    \renewcommand*{\glsclearpage}{}
    }
\setglossarystyle{BibleStyle}

\usepackage{color}%颜色设置
\newcommand{\anewcounter}[2]{\newcounter{#1}\setcounter{#1}{#2}}%定义计数器并赋值
\newcommand{\Fontsize}[1]{\fontsize{#1 pt}{#1 pt}\selectfont}%设置字号与行距
\renewcommand{\And}{\par\vspace{0.5em}\par}
\anewcounter{titleleftskip}{30}%标题左缩进,单位pt
\anewcounter{titletopskip}{50}%标题顶缩进,单位pt
\anewcounter{titlemainsize}{100}%大标题字号,单位pt
\anewcounter{titleauthorsize}{40}%作者信息字号,单位pt
\anewcounter{titlemainlength}{600}%总长度,单位pt
\anewcounter{titleauthorlength}{400}%副作者长度=总长度-200,单位pt
\AtBeginDocument{
    \frontmatter%前言
    \begin{multicols}{2}
    \tableofcontents
    \vspace*{\fill}\columnbreak
    \hspace*{\thetitleleftskip pt}
    \begin{minipage}[t][\thetitlemainlength pt][t]{30em}\vspace{\thetitletopskip pt}
        \parbox[t][\thetitlemainlength pt][t]{2.5pt}{\color{cyan}\rule{0.25em}{\thetitlemainlength pt}}\hspace{1em}
        \parbox[t][\thetitlemainlength pt][t]{\thetitleauthorsize pt}{
            \parbox[t][200pt][t]{\thetitleauthorsize pt}{\Fontsize{\thetitleauthorsize}\rotatebox{-90}{\Fontsize{\thetitleauthorsize}{\(\left[\text{\Author}\right]\)}}\\制}
            \parbox[b][\thetitleauthorlength pt][b]{\thetitleauthorsize pt}{\Fontsize{\thetitleauthorsize}\rotatebox{-90}{[}\\\nextauthor\\\rotatebox{-90}{\hspace*{-0.85em}]}\vspace*{-0.65em}\\原著}
        }\hspace{1em}
        \parbox[t][\thetitlemainlength pt][c]{\thetitlemainsize pt}{\Fontsize{\thetitlemainsize}\textbf{\Title}}\hspace{1em}
        \parbox[t][\thetitlemainlength pt][c]{2.5pt}{\color{cyan}\rule{0.25em}{\thetitlemainlength pt}}
    \end{minipage}
    \clearpage
    \setglossarypreamble[symbols]{%符号表
        \glsresetentrycounter
        \noindent 为简洁易认,本笔记并没有按照原书的符号进行,而是采用了笔者的习惯,具体如下:}
    \printnoidxglossary[type=symbols,title=符号说明,sort=def]%按照输入顺序
    \clearpage
    }
\AtEndDocument{
    \end{multicols}
    }